3.1.86 \(\int \frac {\sqrt {a-a \sin (e+f x)}}{\sqrt {-\sin (e+f x)}} \, dx\) [86]

Optimal. Leaf size=38 \[ \frac {2 \sqrt {a} \sin ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a-a \sin (e+f x)}}\right )}{f} \]

[Out]

2*arcsin(cos(f*x+e)*a^(1/2)/(a-a*sin(f*x+e))^(1/2))*a^(1/2)/f

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.071, Rules used = {2853, 222} \begin {gather*} \frac {2 \sqrt {a} \text {ArcSin}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a-a \sin (e+f x)}}\right )}{f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sqrt[a - a*Sin[e + f*x]]/Sqrt[-Sin[e + f*x]],x]

[Out]

(2*Sqrt[a]*ArcSin[(Sqrt[a]*Cos[e + f*x])/Sqrt[a - a*Sin[e + f*x]]])/f

Rule 222

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSin[Rt[-b, 2]*(x/Sqrt[a])]/Rt[-b, 2], x] /; FreeQ[{a, b}
, x] && GtQ[a, 0] && NegQ[b]

Rule 2853

Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]/Sqrt[(d_.)*sin[(e_.) + (f_.)*(x_)]], x_Symbol] :> Dist[-2/f, Su
bst[Int[1/Sqrt[1 - x^2/a], x], x, b*(Cos[e + f*x]/Sqrt[a + b*Sin[e + f*x]])], x] /; FreeQ[{a, b, d, e, f}, x]
&& EqQ[a^2 - b^2, 0] && EqQ[d, a/b]

Rubi steps

\begin {align*} \int \frac {\sqrt {a-a \sin (e+f x)}}{\sqrt {-\sin (e+f x)}} \, dx &=-\frac {2 \text {Subst}\left (\int \frac {1}{\sqrt {1-\frac {x^2}{a}}} \, dx,x,-\frac {a \cos (e+f x)}{\sqrt {a-a \sin (e+f x)}}\right )}{f}\\ &=\frac {2 \sqrt {a} \sin ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a-a \sin (e+f x)}}\right )}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 0.31, size = 119, normalized size = 3.13 \begin {gather*} -\frac {\sqrt {-1+e^{2 i (e+f x)}} \left (\tan ^{-1}\left (\sqrt {-1+e^{2 i (e+f x)}}\right )+i \tanh ^{-1}\left (\frac {e^{i (e+f x)}}{\sqrt {-1+e^{2 i (e+f x)}}}\right )\right ) \sqrt {a-a \sin (e+f x)}}{\left (-i+e^{i (e+f x)}\right ) f \sqrt {-\sin (e+f x)}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[a - a*Sin[e + f*x]]/Sqrt[-Sin[e + f*x]],x]

[Out]

-((Sqrt[-1 + E^((2*I)*(e + f*x))]*(ArcTan[Sqrt[-1 + E^((2*I)*(e + f*x))]] + I*ArcTanh[E^(I*(e + f*x))/Sqrt[-1
+ E^((2*I)*(e + f*x))]])*Sqrt[a - a*Sin[e + f*x]])/((-I + E^(I*(e + f*x)))*f*Sqrt[-Sin[e + f*x]]))

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(270\) vs. \(2(32)=64\).
time = 16.38, size = 271, normalized size = 7.13

method result size
default \(\frac {\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, \sin \left (f x +e \right ) \left (\ln \left (-\frac {\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}\, \sin \left (f x +e \right )-\cos \left (f x +e \right )+\sin \left (f x +e \right )+1}{\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}\, \sin \left (f x +e \right )+\cos \left (f x +e \right )-\sin \left (f x +e \right )-1}\right )-\ln \left (-\frac {\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}\, \sin \left (f x +e \right )+\cos \left (f x +e \right )-\sin \left (f x +e \right )-1}{\sqrt {-\frac {-1+\cos \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {2}\, \sin \left (f x +e \right )-\cos \left (f x +e \right )+\sin \left (f x +e \right )+1}\right )\right ) \sqrt {2}}{2 f \sqrt {-\sin \left (f x +e \right )}\, \left (-1+\cos \left (f x +e \right )+\sin \left (f x +e \right )\right )}\) \(271\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a-a*sin(f*x+e))^(1/2)/(-sin(f*x+e))^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/2/f*(-(-1+cos(f*x+e))/sin(f*x+e))^(1/2)*(-a*(sin(f*x+e)-1))^(1/2)*sin(f*x+e)*(ln(-((-(-1+cos(f*x+e))/sin(f*x
+e))^(1/2)*2^(1/2)*sin(f*x+e)-cos(f*x+e)+sin(f*x+e)+1)/((-(-1+cos(f*x+e))/sin(f*x+e))^(1/2)*2^(1/2)*sin(f*x+e)
+cos(f*x+e)-sin(f*x+e)-1))-ln(-((-(-1+cos(f*x+e))/sin(f*x+e))^(1/2)*2^(1/2)*sin(f*x+e)+cos(f*x+e)-sin(f*x+e)-1
)/((-(-1+cos(f*x+e))/sin(f*x+e))^(1/2)*2^(1/2)*sin(f*x+e)-cos(f*x+e)+sin(f*x+e)+1)))/(-sin(f*x+e))^(1/2)/(-1+c
os(f*x+e)+sin(f*x+e))*2^(1/2)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a-a*sin(f*x+e))^(1/2)/(-sin(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

integrate(sqrt(-a*sin(f*x + e) + a)/sqrt(-sin(f*x + e)), x)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 103 vs. \(2 (34) = 68\).
time = 0.42, size = 371, normalized size = 9.76 \begin {gather*} \left [\frac {\sqrt {-a} \log \left (\frac {128 \, a \cos \left (f x + e\right )^{5} - 128 \, a \cos \left (f x + e\right )^{4} - 416 \, a \cos \left (f x + e\right )^{3} + 128 \, a \cos \left (f x + e\right )^{2} + 8 \, {\left (16 \, \cos \left (f x + e\right )^{4} - 24 \, \cos \left (f x + e\right )^{3} - 66 \, \cos \left (f x + e\right )^{2} - {\left (16 \, \cos \left (f x + e\right )^{3} + 40 \, \cos \left (f x + e\right )^{2} - 26 \, \cos \left (f x + e\right ) - 51\right )} \sin \left (f x + e\right ) + 25 \, \cos \left (f x + e\right ) + 51\right )} \sqrt {-a \sin \left (f x + e\right ) + a} \sqrt {-a} \sqrt {-\sin \left (f x + e\right )} + 289 \, a \cos \left (f x + e\right ) - {\left (128 \, a \cos \left (f x + e\right )^{4} + 256 \, a \cos \left (f x + e\right )^{3} - 160 \, a \cos \left (f x + e\right )^{2} - 288 \, a \cos \left (f x + e\right ) + a\right )} \sin \left (f x + e\right ) + a}{\cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1}\right )}{4 \, f}, -\frac {\sqrt {a} \arctan \left (\frac {{\left (8 \, \cos \left (f x + e\right )^{2} - 8 \, \sin \left (f x + e\right ) - 9\right )} \sqrt {-a \sin \left (f x + e\right ) + a} \sqrt {a} \sqrt {-\sin \left (f x + e\right )}}{4 \, {\left (2 \, a \cos \left (f x + e\right )^{3} - a \cos \left (f x + e\right ) \sin \left (f x + e\right ) - 2 \, a \cos \left (f x + e\right )\right )}}\right )}{2 \, f}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a-a*sin(f*x+e))^(1/2)/(-sin(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

[1/4*sqrt(-a)*log((128*a*cos(f*x + e)^5 - 128*a*cos(f*x + e)^4 - 416*a*cos(f*x + e)^3 + 128*a*cos(f*x + e)^2 +
 8*(16*cos(f*x + e)^4 - 24*cos(f*x + e)^3 - 66*cos(f*x + e)^2 - (16*cos(f*x + e)^3 + 40*cos(f*x + e)^2 - 26*co
s(f*x + e) - 51)*sin(f*x + e) + 25*cos(f*x + e) + 51)*sqrt(-a*sin(f*x + e) + a)*sqrt(-a)*sqrt(-sin(f*x + e)) +
 289*a*cos(f*x + e) - (128*a*cos(f*x + e)^4 + 256*a*cos(f*x + e)^3 - 160*a*cos(f*x + e)^2 - 288*a*cos(f*x + e)
 + a)*sin(f*x + e) + a)/(cos(f*x + e) - sin(f*x + e) + 1))/f, -1/2*sqrt(a)*arctan(1/4*(8*cos(f*x + e)^2 - 8*si
n(f*x + e) - 9)*sqrt(-a*sin(f*x + e) + a)*sqrt(a)*sqrt(-sin(f*x + e))/(2*a*cos(f*x + e)^3 - a*cos(f*x + e)*sin
(f*x + e) - 2*a*cos(f*x + e)))/f]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sqrt {- a \left (\sin {\left (e + f x \right )} - 1\right )}}{\sqrt {- \sin {\left (e + f x \right )}}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a-a*sin(f*x+e))**(1/2)/(-sin(f*x+e))**(1/2),x)

[Out]

Integral(sqrt(-a*(sin(e + f*x) - 1))/sqrt(-sin(e + f*x)), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 99 vs. \(2 (34) = 68\).
time = 0.76, size = 99, normalized size = 2.61 \begin {gather*} -\frac {4 \, \sqrt {a} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} + \frac {2 \, {\left (2 \, \sqrt {2} - \sqrt {-\tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, f x + \frac {1}{4} \, e\right )^{4} + 6 \, \tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, f x + \frac {1}{4} \, e\right )^{2} - 1}\right )}}{\tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, f x + \frac {1}{4} \, e\right )^{2} - 3}\right )}\right ) \mathrm {sgn}\left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a-a*sin(f*x+e))^(1/2)/(-sin(f*x+e))^(1/2),x, algorithm="giac")

[Out]

-4*sqrt(a)*arctan(-1/2*sqrt(2)*(sqrt(2) + 2*(2*sqrt(2) - sqrt(-tan(-1/8*pi + 1/4*f*x + 1/4*e)^4 + 6*tan(-1/8*p
i + 1/4*f*x + 1/4*e)^2 - 1))/(tan(-1/8*pi + 1/4*f*x + 1/4*e)^2 - 3)))*sgn(sin(-1/4*pi + 1/2*f*x + 1/2*e))/f

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.03 \begin {gather*} \int \frac {\sqrt {a-a\,\sin \left (e+f\,x\right )}}{\sqrt {-\sin \left (e+f\,x\right )}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a - a*sin(e + f*x))^(1/2)/(-sin(e + f*x))^(1/2),x)

[Out]

int((a - a*sin(e + f*x))^(1/2)/(-sin(e + f*x))^(1/2), x)

________________________________________________________________________________________